package com.yunzheng.util;

import com.yunzheng.constants.SystemConstants;
import org.springframework.util.DigestUtils;

/**
 * <p>
 * md5加密，用于生成密码
 * </p>
 *
 * @author 杜奕明
 * @date 2019/10/1
 */
public class Md5Util {

    public static String toMd5(String src) {
        if (src == null) {
            return null;
        }
        String digest = src + SystemConstants.PASSWORD_PRE;
        return DigestUtils.md5DigestAsHex(digest.getBytes());
    }

}
